<?php

declare(strict_types=1);

namespace Modules\Promanagement\Models;

use Catch\Base\CatchModel as Model;

/**
 * @property $id
 * @property $workingcode
 * @property $processname
 * @property $description
 * @property $modifier
 * @property $creator_id
 * @property $created_at
 * @property $updated_at
 * @property $deleted_at
*/
class Processdata extends Model
{
    public static function processtype(){
        $processtype = [
            [
                'value'=>1,
                'label'=>'转移'
            ],
            [
                'value'=>2,
                'label'=>'过站'
            ],
            [
                'value'=>3,
                'label'=>'报工'
            ],
            [
                'value'=>4,
                'label'=>'排产'
            ],
            [
                'value'=>5,
                'label'=>'派工'
            ],
            [
                'value'=>6,
                'label'=>'投料'
            ],
            [
                'value'=>7,
                'label'=>'报废'
            ],
    
        ];
        return $processtype;
    }
    protected $table = 'processdata';
    protected $fillable = [ 'id', 'workingcode', 'processname', 'description', 'modifier', 'creator_id', 'created_at', 'updated_at', 'deleted_at' , 'processtype' , 'toallow' ];

    /**
     * @var array
     */
    protected array $fields = ['id','workingcode','processname','description','modifier', 'creator_id','created_at','updated_at', 'processtype' , 'toallow' ];

    /**
     * @var array
     */
    protected array $form = ['id','workingcode','processname','description','modifier', 'creator_id','created_at','updated_at', 'processtype' , 'toallow' ];

    
    /**
     * @var array
     */
    public array $searchable = [
        'workingcode' => 'like',
        'processname' => 'like',
        'description' => 'like',
    ];

   
    //输出相应的时间格式
    protected function serializeDate($date)
    {
        return $date->format('Y-m-d H:i');
    }
  
    
}
